import render from "./render.js";
import loadata from "./loadata.js";

function Floor(){}

$.extend(Floor.prototype,{
    init(){
        var $floors = $(".floors");

        loadata.floorLoad().then(function(res) {
            var html = render.init(res.data, "floors");
            $floors.html(html);

            var $prev = $(".carrousel-container .show-prev");
            var $next = $(".carrousel-container .show-next");

            $prev.on("click",render.changeList);
            $next.on("click",render.changeList);
        });
    }
});

export default new Floor();